<template>
  <el-dialog v-model="dialogVisible" title="派工时间" width="500">
    <el-date-picker
      :model-value="_props.startDateTemp"
      placeholder="选择日期"
      type="date"
      @update:model-value="(e) => changeStartDateTemp(e)"
    />
    <template #footer>
      <div class="dialog-footer">
        <el-button @click="close">取消</el-button>
        <el-button type="primary" @click="toConfirm()">确认</el-button>
      </div>
    </template>
  </el-dialog>
</template>
<script setup>
  const dialogVisible = ref(false)
  const _props = defineProps({
    startDateTemp: {
      type: [String, Object],
      default: () => null,
    },
  })
  const close = () => {
    dialogVisible.value = false
  }
  const toConfirm = () => {
    _emits('selectDateCallback')
    close()
  }
  const changeStartDateTemp = (e) => {
    _emits('update:modelValue', e)
  }
  const _emits = defineEmits(['update:modelValue'])
  defineExpose({
    handleOpen: () => {
      dialogVisible.value = true
    },
  })
</script>
<style lang="scss" scoped></style>
